<include file="Public:header" />
<style type="text/css">
    .switchery {
        background-color: #fff;
        border: 1px solid #dfdfdf;
        border-radius: 20px;
        cursor: pointer;
        display: inline-block;
        height: 20px;
        position: relative;
        vertical-align: middle;
        width: 40px;
    }
    .switchery > small {
        background: #fff;
        border-radius: 100%;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
        height: 17px;
        position: absolute;
        top: 0;
        width: 17px;
    }
    .up0{box-shadow: #dfdfdf 0px 0px 0px 0px inset; border-color: #dfdfdf; transition: border 0.4s, box-shadow 0.4s;}
    .up0 small{left: 0px; transition: left 0.2s;}

    .up1{box-shadow: #64bd63 0px 0px 0px 16px inset; border-color: #64bd63; transition: border 0.4s, box-shadow 0.4s, background-color 1.2s; background-color: #64bd63;}
    .up1 small{left: 23px; transition: left 0.2s;}
</style>
<!-- main content start-->
<div class="main-content" >

    <!-- header section start-->
    <div class="header-section">
        <!--toggle button start-->
        <a class="toggle-btn"><i class="fa fa-bars"></i></a>
        <!--toggle button end-->
        <!--notification menu start -->
        <div class="menu-right">
            <ul class="notification-menu">
                <li>
                    <a href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                        <img src="__IMG__/photos/user-avatar.png" alt="" />
                        {$shopname}
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                        <li><a href="{:U('Rootadmin/Login/changePwd')}"><i class="fa fa-cog"></i>  修改密码</a></li>
                        <li><a href="{:U('Rootadmin/Login/logout')}"><i class="fa fa-cog"></i>  退出登录</a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <!--notification menu end -->
    </div>
    <!-- header section end-->
    <!-- page heading start-->
    <div class="page-heading">
        <h3>
            商户管理
        </h3>
        <ul class="breadcrumb">
            <li>
                <a href="#">首页</a>
            </li>
            <li> 商户管理 </li>
            <li class="active"> 商户二维码 </li>
        </ul>
    </div>
    <!-- page heading end-->

    <!--body wrapper start-->
    <div class="wrapper">

        <section class="panel">
            <div class="panel-body">
                <section id="unseen">
                    <table class="table table-bordered table-striped table-condensed">
                        <thead>
                        <tr>
                            <th>联系人</th>
                            <th>电话</th>
                            <th>标题</th>
                            <th>内容</th>
                            <th>图片</th>
                            <th>二维码</th>
                            <th>金额</th>
                            <th>添加时间</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="info" id="vo">
                            <tr>
                                <td>{$vo.linker}</td>
                                <td>{$vo.phone}</td>
                                <td>{$vo.title}</td>
                                <td>{$vo.content}</td>
                                <td><img src="{$vo.image}" width="50"></td>
                                <td><img src="/{$vo.codeimg}" width="50"></td>
                                <td>{$vo.money}</td>
                                <td>
                                    <empty name="vo.addtime">
                                        -
                                        <else/>
                                        {$vo.addtime|date="Y-m-d H:i:s",###}
                                    </empty>
                                </td>
                                <td><span class="switchery up{$vo.status}" data-id="{$vo.id}"><small></small></span></td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="dataTables_paginate paging_bootstrap pagination">
                                {$pages}
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </section>
    </div>
    <!--body wrapper end-->
    <!-- main content end-->
    <link href="__PUBLIC__/css/popwin.css" rel="stylesheet" />
    <script src="__PUBLIC__/js/popwin.js"></script>
    <script>
        $(function(){
            $(".switchery").click(function(){
                if(confirm("确认操作商户的二维码申请吗")){
                    var url = "{:U('Rootadmin/shop/pass')}";
                    var id = $(this).attr("data-id");
                    var obj = $(this);
                    $.get(url, {id:id}, function(res){
                        if(res.up == 1){
                            obj.removeClass("up0").addClass("up1");
                        }else{
                            obj.removeClass("up1").addClass("up0");
                        }
                    }, "json");
                }else{
                    return false;
                }

            });
        });
    </script>
    <include file="Public:footer" />